// ////////////////////////////////////////////////////////////////////////////////////////
// NAME: MainActivity.java 
// AUTHOR: CDT Riley Mckenna 
// LAST MODIFIED: 28 March 2012 
// DESCRIPTION: Starts Nullwall
// LIMITATIONS: 
// CITATIONS: In code
// 
// ////////////////////////////////////////////////////////////////////////////////////////
package prototype.revision;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainActivity extends TabActivity {
	/** Called when the activity is first created. */
	private Intent intent;
	private TabHost myHost;
	private TabSpec mySpec;
	private Resources resource;
	final String TAG = "Main_Activity";
	private static final int HELLO_ID = 1;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.basiclayoutmain);

		resource = this.getResources();
		myHost = this.getTabHost();

		// General page
		intent = new Intent().setClass(this, Home.class);
		mySpec = myHost
				.newTabSpec("home")
				.setIndicator("Home",
						resource.getDrawable(R.drawable.ic_menu_star))
				.setContent(intent);
		myHost.addTab(mySpec);
		Log.i(TAG, "General Page Tab Created with Intent.");

		// General Firewall Setting
		intent = new Intent().setClass(this, ListViewActivity.class);
		mySpec = myHost
				.newTabSpec("firewall")
				.setIndicator("Firewall",
						resource.getDrawable(R.drawable.nullwall_icon))
				.setContent(intent);
		myHost.addTab(mySpec);
		Log.i(TAG, "FireWall Tab Created with Intent.");

		// General Analyzer
		intent = new Intent().setClass(this, BatteryScanner.class);
		mySpec = myHost
				.newTabSpec("analyzer")
				.setIndicator("Battery Stats",
						resource.getDrawable(R.drawable.battery_empty))
				.setContent(intent);
		myHost.addTab(mySpec);
		Log.i(TAG, "General Analyzer Tab Created with Intent.");

		// General About
		intent = new Intent().setClass(this, AboutActivity.class);
		mySpec = myHost
				.newTabSpec("about")
				.setIndicator("About",
						resource.getDrawable(R.drawable.ic_tab_events))
				.setContent(intent);
		myHost.addTab(mySpec);
		Log.i(TAG, "About Tab Created with Intent.");

		myHost.setCurrentTab(0);
		Log.i(TAG, "Home Page Created at General Tab");

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		Log.i(TAG, "Menu Opened.");
		return true;
	}

}
